
package com.feib.soeasy.dao;

import java.util.Date;
import java.util.List;

import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.feib.soeasy.job.importor.PyerImportJob;
import com.feib.soeasy.model.PayerTemp;
import com.feib.soeasy.model.UploadFile;



/**
 * @title (#)PayerTempTester.java<br>
 * @description <br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2011/3/17 create by Jimmy Liu<br>
 */
public class PayerTempTester {
    private static ApplicationContext context;

    private static PayerTempDao payerTempDao;
    
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    @BeforeClass
    public static void runBeforeClass()
    {
        context = new FileSystemXmlApplicationContext(new String[] {
                        "src/main/webapp/WEB-INF/spring/applicationContext-config.xml"
                        , "src/main/webapp/WEB-INF/spring/applicationContext-dao.xml"
                        , "src/main/webapp/WEB-INF/spring/applicationContext-hibernate.xml"
        });

        payerTempDao = (PayerTempDao) context.getBean("payerDao");

    }
    

    @Test
    public void queryPaginationByPayment()
    {
        PyerImportJob pij = new PyerImportJob();
        
        UploadFile uploadFile = new UploadFile();
        uploadFile.setUploadFilePk(new Long(10));
       
        uploadFile.setCreatedBy("Jimmy");
        long pk =8;
        
        pij.execute(pk);
        
       
        List<PayerTemp> test =payerTempDao.findByUploadFilePk(pk);
        
        logger.info(test.toString());
    }
}
